/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controlador;

import java.awt.CardLayout;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import vista.panel.InterfazHistoricos;
import vista.panel.InterfazEstadoValvula;
import vista.panel.Mensajes;

/**
 *
 * @author Elias Mendoza
 */
public class EventoPanel {
  public JPanel panel;
  public JPanel contenedorPanel;
  
  public EventoPanel(){ 
  }
  public EventoPanel(JPanel contenedorPanel){
    this.contenedorPanel=contenedorPanel;
  }

  public void setContenedorPanel(JPanel contenedorPanel) {
    this.contenedorPanel = contenedorPanel;
  }
  
  public void cargaPanelEstadoValvula(){
    panel = (JPanel) new InterfazEstadoValvula();
    System.out.println("cargando panel");
    aderirPanel(panel);
    System.out.println("cargando panel");
  }
//  public void cargaPanelHistoricos(){
//    panel = (JPanel) new InterfazHistoricos();
//    aderirPanel(panel);
//  }

  private void aderirPanel(JPanel p){
    p.setSize(contenedorPanel.getSize());
    contenedorPanel.add("panel",p);
    CardLayout cl = (CardLayout) contenedorPanel.getLayout();
    cl.show(contenedorPanel, "panel");
  }
  
}
